//
// Created by ly-zhouxyi on 2024/3/5.
//

#ifndef FFMPEGPLAYER_DATAQUEUE_H
#define FFMPEGPLAYER_DATAQUEUE_H

#include "queue"
#include "pthread.h"
#include "AndroidLog.h"
#include "Playstatus.h"

extern "C"
{
#include "libavcodec/avcodec.h"
};

class DataQueue {
public:
    PlayStatus *playStatus=NULL;
    std::queue<AVPacket *>queuePacket;
    pthread_mutex_t mutexPacket;
    pthread_cond_t condPacket;

     DataQueue(PlayStatus *playStatus);
    int putAvPacket(AVPacket *packet);
    int getAvPacket(AVPacket *packet);

    int getQueueSize();

    void clearAvPacket();
     ~DataQueue();
};


#endif //FFMPEGPLAYER_DATAQUEUE_H
